#ifndef _APP_ETHCAT_MASTER_H_
#define _APP_ETHCAT_MASTER_H_
#include "board.h"

#include "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatdc.h"
#include "ethercatcoe.h"
#include "ethercatsoe.h"
#include "ethercatconfig.h"
#include "ethercatprint.h"

#if RGMII
#define ENET_INF_TYPE       enet_inf_rgmii
#define ENET                BOARD_ENET_RGMII
#else
#define ENET_INF_TYPE       enet_inf_rmii
#define ENET                BOARD_ENET_RMII
#endif

#define ENET_TX_BUFF_COUNT  (50U)
#define ENET_RX_BUFF_COUNT  (60U)
#define ENET_RX_BUFF_SIZE   ENET_MAX_FRAME_SIZE
#define ENET_TX_BUFF_SIZE   ENET_MAX_FRAME_SIZE

/* MAC ADDRESS */
//#define MAC_ADDR0   0x98
//#define MAC_ADDR1   0x2C
//#define MAC_ADDR2   0xBC
//#define MAC_ADDR3   0xB1
//#define MAC_ADDR4   0x9F
//#define MAC_ADDR5   0x17

#define MAC_ADDR0   0x00
#define MAC_ADDR1   0x80
#define MAC_ADDR2   0xE1
#define MAC_ADDR3   0x00
#define MAC_ADDR4   0x00
#define MAC_ADDR5   0x00
void ethcat_init(void);
uint64_t ethcat_get_tick_count(void);
void ethcat_delay_us(uint32_t time);
int bfin_emac_send (void *packet, int length);
int bfin_emac_recv (uint8_t * packet, size_t size);

#endif
